#!/usr/bin/python3
# -*- coding:utf-8 -*-
"""
@author: 
@time: 2024/2/28 9:04 PM
@Function: 执行入口
"""
import os
import shutil

import pytest
from config.setting import FILE_PATH

if __name__ == '__main__':
    # 执行代码开启allure输出测试报告的功能-->json格式
    # pytest.main(["-v", "-s", "-m test1", "--headed", "--slowmo=1000", '--reruns=0', "--html=html_report/myreport.html",
    #              "--self-contained-html", "--capture=tee-sys",
    #              f'--alluredir={FILE_PATH["allure_result_path"]}',
    #              "--clean-alluredir"])
    pytest.main()
    shutil.copy('./environment.xml', './allure_result')
    # 代码执行完成后，借助allure组件将json输出成html
    os.system(f'allure generate {FILE_PATH["allure_result_path"]} -o {FILE_PATH["allure_report_path"]} --clean')
